<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>
<script>
	let arr1 = [1,20,-5,3];
	let result1 = arr1.reduce(function (a, b) {
		//1 20
		//21 -5
		//16 3
		console.log(a, b)
		return a + b
	})
	console.log(result1)
	let result2 = arr1.reduce((a, b) => a + b)
	console.log(result2)
	let result3 = arr1.reduce((a, b) => a * b)
	console.log(result3)
	let result4 = arr1.reduce(function (a, b) {
		//0 1
		//0 20
		//0 -5
		console.log(a, b)
		return a * b
	}, 0)
	console.log(result4)
	let result5 = arr1.reduce((a, b) => a + b, 0)
</script>
</body>
</html>